Skip to main content

All Questions

4votes
2answers
165views

Sort a dict by keys, assuming keys are orderable

I found a suspicious code snipped in an existing project in which I am involved as a developer. The code sorts a dict by its keys, so that if iterated over the dict,...
Looser User's user avatar
1vote
1answer
107views

Unscramble words faster in Python

So I'm currently using python to unscramble words that are retrieved from an OCR program, and checked in the 'dictionary'. The current code I am using to unscramble words is this: ...
Adam's user avatar
3votes
2answers
9kviews

Sort dictionary by increasing length of its values

Given a dictionary where the values are iterables, print the dictionary sorted by the length of its values. ...
Gao's user avatar
  • 1,140
5votes
1answer
4kviews

Ranking players in a league by sorting the contents of an OrderedDict

I'm new to python. I'm having second thoughts on my approach to this problem: The LeagueTable class tracks the score of each player in a league. After each game, the player records their score with ...
Vipin Mohan R Nair's user avatar
5votes
1answer
254views

Finding added keys, removed keys, and unchanged keys in ordereddict

I'm comparing two OrderedDict objects and I need to find added keys, removed keys, and keys that are present in both (the intersection). Sets are designed for ...
Conor Mancone's user avatar
2votes
1answer
1kviews

Clustering similar tweets in a corpus

I am attempting to write a statistical program using an LDA model I've trained/created using Gensim. I am very new to Python and am a student level programmer. This current program is working and ...
kethort's user avatar

close